package topt_12z.network;

import java.util.logging.Logger;

import topt_12z.general.Globals;

@SuppressWarnings("serial")
public class PacketEvent extends java.util.EventObject {
	private Logger log;

	private Long ID = -1L;
	private Integer startTime = -1;
	private Integer endTime = -1;
	private String 	generatedRoute = "";
	private String 	routeRecord = "";
	private Integer hopCounter = 0;
	private Integer destAddressRow = -1;
	private Integer destAddressCol = -1;
	private Integer fromAddressRow = -1;
	private Integer fromAddressCol = -1;

	public PacketEvent(Object obj) {
		super(obj);
	}

	@Override
	public String toString() {
		return "Type: " + this.getClass().getSimpleName() + ", getID: "
				+ this.getID() + "";
	}

	public String toFullString() {
		return "Type: " + this.getClass().getSimpleName() + ", getID: "
				+ this.getID() + "";
	}

	public synchronized Integer getStartTime() {
		return startTime;
	}

	public synchronized void setStartTime(Integer startTime) {
		this.startTime = startTime;
	}

	public synchronized Integer getEndTime() {
		return endTime;
	}

	public synchronized void setEndTime(Integer endTime) {
		this.endTime = endTime;
	}

	public void setID(Long iD) {
		ID = iD;
	}

	public Long getID() {
		return ID;
	}

	public String getRouteRecord() {
		return routeRecord;
	}

	public void setRouteRecord(String routeRecord) {
		this.routeRecord = routeRecord;
	}

	public void addRouteRecordHop(String nodeName) {
		this.routeRecord = this.routeRecord + Globals.ROUTE_RECORD_SEPARATOR + nodeName;
	}

	public Integer getHopCounter() {
		return hopCounter;
	}

	public void incrHopCounter() {
		this.hopCounter++;
	}

	public Integer getDestAddressRow() {
		return destAddressRow;
	}

	public void setDestAddressRow(Integer destAddressRow) {
		this.destAddressRow = destAddressRow;
	}

	public Integer getDestAddressCol() {
		return destAddressCol;
	}

	public void setDestAddressCol(Integer destAddressCol) {
		this.destAddressCol = destAddressCol;
	}

	public Integer getFromAddressRow() {
		return fromAddressRow;
	}

	public void setFromAddressRow(Integer fromAddressRow) {
		this.fromAddressRow = fromAddressRow;
	}

	public Integer getFromAddressCol() {
		return fromAddressCol;
	}

	public void setFromAddressCol(Integer fromAddressCol) {
		this.fromAddressCol = fromAddressCol;
	}

	public String getGeneratedRoute() {
		return generatedRoute;
	}

	public void setGeneratedRoute(String generatedRoute) {
		this.generatedRoute = generatedRoute;
	}

}
